import request from '@/utils/request'
import qs from 'qs'

/* 根据id查询 Subject */
export function getSubjectApi(id) {
  return request({
    url: `/subject/${id}`,
    method: 'get'
  })
}
/* 条件、分页查询 Subject */
export function getSubjectsApi(pageNo, pageSize, subject) {
  return request({
    url: `/subject?${qs.stringify(subject)}`,
    params:{
      pageNo: pageNo,
      pageSize: pageSize,
    },
    method: 'get'
  })
}
/* 根据id删除 Subject */
export function delSubjectApi(id) {
  return request({
    url: `/subject/${id}`,
    method: 'delete'
  })
}
/* 批量删除 Subject */
export function delSubjectsApi(subjects) {
  return request({
    url: `/subject`,
    data: subjects,
    method: 'delete'
  })
}
/* 修改 Subject */
export function updateSubjectApi(form) {
  return request({
    url: `/subject`,
    method: 'put',
    data: form
  })
}
/* 新增 Subject */
export function addSubjectApi(form) {
  return request({
    url: `/subject`,
    method: 'post',
    data: form
  })
}
/* 查询所有 Subject */
export function getAllSubjectsApi() {
  return request({
    url: `/subject/findAll`,
    method: `get`
  })
}
export function getAllSubjectApi() {
  return request({
    url: `/subject/findAll`,
    method: 'get'
  })
}